//
//  SubjectViewController.m
//  test1
//
//  Created by 衣尚品1 on 15/4/30.
//  Copyright (c) 2015年 衣尚品1. All rights reserved.
//

#import "SubjectViewController.h"

@interface SubjectViewController ()

@end

@implementation SubjectViewController{
    BOOL viewIsHide;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.YYHight.constant = 30;
    self.hideView.hidden = YES;
    viewIsHide = YES;
    [self.image setImage:[UIImage imageNamed:@"down.png"]];

}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)clickHideButton:(id)sender {
    if (viewIsHide) {
        self.YYHight.constant = 250;
        self.ChineseHeight.constant = 58;
        self.ChineseWidth.constant = 70;
        
        [UIView animateWithDuration:0.3 animations:^{
            [self.view layoutIfNeeded];
            
        }];
        [self performSelector:@selector(show) withObject:nil afterDelay:0.1f];
        viewIsHide = NO;
        [self.image setImage:[UIImage imageNamed:@"up.png"]];
    }
    else {
        self.YYHight.constant = 30;
        self.ChineseHeight.constant = 90;
        self.ChineseWidth.constant = 90;
        
        [UIView animateWithDuration:0.3 animations:^{
            [self.view layoutIfNeeded];
            
        }];
        [self performSelector:@selector(hide) withObject:nil afterDelay:0.1f];
        viewIsHide = YES;
        [self.image setImage:[UIImage imageNamed:@"down.png"]];
    }

}

- (void)hide{
    self.hideView.hidden = YES;
}

- (void)show{
    self.hideView.hidden = NO;
}

@end
